package com.treasure.mall.biz.service.core.pay;

import com.treasure.mall.biz.dto.pay.PayDTO;
import com.treasure.mall.biz.dto.pay.PaymentBillSaveDTO;
import com.treasure.mall.biz.entity.order.DealOrderPO;
import com.treasure.mall.biz.entity.pay.PaymentBillPO;
import com.treasure.mall.biz.remote.quickpay.dto.WxTradeOrderDTO;
import com.treasure.mall.zbq.common.ienum.order.OrderEnums;

/**
 * @author allan
 * @version 1.0.0
 * @date 2020/6/13
 */
public interface PayService {
    /**
     * 创建付款单
     *
     * @param paymentBillSaveDTO
     * @return
     */
    PaymentBillPO createBill(PaymentBillSaveDTO paymentBillSaveDTO);

    /**
     * 订单支付
     *
     * @param orderId 订单号
     * @return
     */
    WxTradeOrderDTO pay(String orderId);

    /**
     * 发起支付
     */
    WxTradeOrderDTO pay(PaymentBillPO billPO);

    /**
     * 支付
     *
     * @param payDTO
     * @return
     */
    WxTradeOrderDTO pay(PayDTO payDTO);

    /**
     * 订单支付
     *
     * @param orderPO
     */
    WxTradeOrderDTO pay(DealOrderPO orderPO);

    /**
     * 第三方支付回调
     *
     * @param paymentBillId  支付单号
     * @param thirdTradingNo
     * @param isSuccess
     * @param resultDesc
     */
    void thirdPayed(String paymentBillId, String thirdTradingNo, boolean isSuccess, String resultDesc);

    /**
     * 支付回调
     *
     * @param orderId
     * @param payStatus 支付状态
     */
    void payed(String orderId, OrderEnums.PayStatus payStatus);

    /**
     * 支付超时
     *
     * @param orderId
     */
    void payTimeout(String orderId);
}
